package jpm.common;

public class JPMException extends RuntimeException {
	
	public enum ErrorCode {
		ERROR_ASSERT_FAIL, ERROR_INVALID_INPUT, ERROR_OVERFLOW
	}
	
	private static final long serialVersionUID = 1L;
		
	private ErrorCode errorCode;
	private String userFriendlyMessage;

	public JPMException() {
	}

	public JPMException errorType(ErrorCode errCode) {
		this.errorCode = errCode;
		return this;
	}

	public JPMException message(String userFriendlyMessage) {
		this.userFriendlyMessage = userFriendlyMessage;
		return this;
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public String getUserFriendlyMessage() {
		return userFriendlyMessage;
	}	
}